package com.itcast.mybatis.mapper;

import com.itcast.mybatis.model.CourseBase;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.HashMap;
import java.util.List;

public interface CourseBaseMapper extends Mapper<CourseBase> {


    //定义一个自定义查询接口
    @Select("select * from course_base where name like #{name}")
    List<CourseBase> findListByName(String name);

    @Select("select  * from  course_base cb,course_pub cp where cb.grade = cp.grade and cb.studymodel = cp.studymodel and cb.user_id =#{userId} and  cp.charge = #{charge}")
    public List<HashMap> findListAll(@Param("userId") String userId, @Param("charge") String charge);
}
